//
//  allPriceTableViewCell.m
//  FaceTo
//
//  Created by 程邦明 on 2017/8/8.
//  Copyright © 2017年 chengbangming. All rights reserved.
//

#import "allPriceTableViewCell.h"

@implementation allPriceTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI{
    self.backgroundColor = Color(235, 235, 235);
    
    _bgView = [[UIView alloc]init];
    _bgView.backgroundColor = WhiteColor;
    [self addSubview:_bgView];
    
    _nameLabel = [[UILabel alloc]init];
    _nameLabel.font = [UIFont systemFontOfSize:16];
    _nameLabel.textAlignment = NSTextAlignmentLeft;
    _nameLabel.text = @"消费总额：";
    _nameLabel.textColor = Color(51, 51, 51);
    [_bgView addSubview:_nameLabel];
    
    _priceLabel = [[UILabel alloc]init];
    _priceLabel.font = [UIFont systemFontOfSize:18];
    _priceLabel.textColor = Color(251, 210, 50);
    _priceLabel.textAlignment = NSTextAlignmentRight;
    _priceLabel.text = @"¥25";
    [_bgView addSubview:_priceLabel];
    
    [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.centerY.equalTo(self.mas_centerY);
        make.right.offset(-20);
        make.height.mas_equalTo(70);
    }];
    
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.centerY.equalTo(_bgView.mas_centerY);
        make.height.mas_equalTo(20);
    }];
    
    [_priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-20);
        make.centerY.equalTo(_bgView.mas_centerY);
        make.height.mas_equalTo(20);
    }];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
